import Layout from '../components/Layout'
/*

hidden:true隐藏路由
alwaysShow:true 当路由下面的children只有一个时将路由提前，不显示当前路由
*/

const routes = [
  {
    path: '/',
    component: Layout,
    meta: {
      title: '默认首页'
    },
    alwaysShow: true,
    redirect: '/home',
    children: [
      {
        path: 'home',
        meta: {
          title: '首页',
          icon: 'cms-shouye fontFamily-26'
        },
        component: () => import('../views/Home')
      },
      {
        path: 'profile',
        meta: {
          title: '个人中心',
          icon: 'el-icon-s-promotion'
        },
        hidden: true,
        component: () => import('../views/users/profile/profile')
      }

    ]
  },
  {
    path: '/system',
    meta: {
      title: '商城系统管理'
    },
    alwaysShow: true,
    component: Layout,
    redirect: '/Webset',
    children: [
      {
        path: 'Webset',
        meta: {
          title: '系统管理',
          icon: 'cms-Management_system fontFamily-24'
        },
        component: () => import('../views/sys/Webset')
      }
    ]
  },
  {
    path: '/user',
    meta: {
      title: '客户管理'
    },
    // alwaysShow: true,
    children: [
      {
        path: 'list',
        meta: {
          title: '客户列表',
          icon: 'cms-yonghu1 fontFamily-24'
        },
        component: () => import('../views/users/index')
      }
      // {
      //   path: 'client',
      //   meta: {
      //     title: '商城客户管理',
      //     icon: ''
      //   },
      //   component: () => import('../views/users/client')
      // }

    ],
    component: Layout
  },
  {
    path: '/role',
    // component: Layout,
    meta: {
      title: '角色管理'
    },
    alwaysShow: true,
    component: Layout,
    redirect: '/Permission',
    children: [
      {
        path: 'Permission',
        meta: {
          title: '角色管理',
          icon: 'cms-jiaoseguanli fontFamily-24'
        },
        component: () => import('../views/role/Permission')
      }
    ]
  },
  {
    path: '/supplier',
    meta: {
      title: '供应商管理',
      icon: 'cms-jiaoseguanli fontFamily-24'
    },
    component: Layout,
    children: [
      {
        path: '',
        hidden: true,
        component: () => import('../views/supplier')
      }
    ]
  },
  {
    path: '/commodity',
    meta: {
      title: '商品管理',
      icon: 'cms-navicon-wzgl fontFamily-24'
    },
    component: Layout,
    children: [
      {
        path: 'list',
        meta: {
          title: '商品列表',
          icon: 'cms-wenzhang2 fontFamily-content'
        },
        component: () => import('../views/commodity/List')
      },
      {
        path: 'category',
        meta: {
          title: '商品品类',
          icon: 'cms-wenzhang2 fontFamily-content'
        },
        component: () => import('../views/category/List')
      },
      {
        path: 'add',
        meta: {
          title: '商品添加',
          icon: 'cms-wenzhang2 fontFamily-content'
        },
        component: () => import('../views/commodity/Add')
      }
    ]
  },
  {
    path: '/warehouse',
    meta: {
      title: '仓库管理',
      icon: 'cms-navicon-wzgl fontFamily-24'
    },
    alwaysShow: true,
    component: Layout,
    children: [
      {
        path: '',
        hidden: true,
        component: () => import('../views/warehouse')
      }

    ]
  },
  {
    path: '/manifest',
    meta: {
      title: '订单管理',
      icon: 'cms-navicon-wzgl fontFamily-24'
    },
    alwaysShow: true,
    component: Layout,
    children: [
      {
        path: '',
        hidden: true,
        component: () => import('../views/manifest')
      }

    ]
  },
  {
    path: '/play',
    meta: {
      title: '支付管理',
      icon: 'cms-navicon-wzgl fontFamily-24'
    },
    alwaysShow: true,
    component: Layout,
    children: [
      {
        path: '',
        hidden: true,
        component: () => import('../views/playtype')
      }

    ]
  },

  {
    path: '/about',
    component: Layout,
    meta: {
      title: '关于我们',
      icon: 'cms-guanyuwomen1 fontFamily-26'
    },
    children: [
      {
        hidden: true,
        path: '',
        component: () => import('../views/About')
        // component: () => import('../views/login')

      }
    ]

  },

  // 登录
  {
    path: '/login',
    component: () => import('../views/login'),
    hidden: true,
    meta: {
      title: '登录',
      icon: ''
    }
  },

  //   这个路由一定要放在最后，匹配不到上面的路由，就匹配404路由
  {
    path: '*',
    hidden: true, // 隐藏路由
    meta: {
      title: '404错误'
    },
    component: () => import('../views/error/404')
  }

]

export default routes
